package cn.com.jit.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.com.jit.dao.UserDao;
import cn.com.jit.service.UserService;
import cn.com.jit.vo.User;

@Service("userService")
public class UserServiceImpl implements UserService{

	@Autowired
	private UserDao userDao;
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
	
	@Override
	public List<User> list() {
		// TODO Auto-generated method stub
		return userDao.list();
	}

	@Override
	public int add(User user) {
		// TODO Auto-generated method stub
		
		return userDao.add(user);
	}

	@Override
	public int delete(String id) {
		// TODO Auto-generated method stub
		return userDao.delete(id);
		//return 0;
	}

	@Override
	public User findUserById(String id) {
		// TODO Auto-generated method stub
		return userDao.findUserById(id);
		//return null;
	}

	@Override
	public int updateUser(User user) {
		// TODO Auto-generated method stub
		return userDao.updateUser(user);
	}

}
